package com.sxpcwlkj.framework.config;

/**
 * @author shanpengnian
 * @ClassName DictSensitiveAnnotationIntrospector
 * @description: TODO
 * @date 2024年03月29日
 * @version: 1.0
 */

import com.fasterxml.jackson.databind.introspect.Annotated;
import com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector;
import com.sxpcwlkj.common.annotation.Dict;
import org.springframework.stereotype.Component;

/**
 * 字典注解序列化拦截器
 * @author shanpengnian
 */
@Component
public class DictSensitiveAnnotationIntrospector extends NopAnnotationIntrospector {

    private static final long serialVersionUID = 1L;

    @Override
    public Object findSerializer(Annotated am) {
        Dict dict = am.getAnnotation(Dict.class);
        if (dict != null){
            return DictSerializer.class;
        }
        return null;
    }
}
